<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="${pageContext.request.contextPath}/styly.css" type="text/css" rel="stylesheet"/>
        <title><spring:message code="employeelist.head"/></title>
    </head>
    <body>
        <div class="wrapper">
            <div class="header"><h1> <spring:message code="employeelist.title"/> </h1></div>
            <div class="navig">
                <%@ include file="../navig.jsp" %>
            </div>    
            <div class="content">
                <div style="color: green;"><spring:message code="${infoMessage}"/></div>
                <div style="width: 60%;">


                    <h3><spring:message code="employeelist.contentheader"/></h3>
                    <table>
                        <tr class="head">
                            <td><b><spring:message code="employeelist.meno"/></b></td>
                            <td><b><spring:message code="employeelist.priezvisko"/></b></td>
                            <td><b><spring:message code="employeelist.datumnarodenia"/></b></td>
                            <td><b><spring:message code="employeelist.username"/></b></td>
                            <td><b><spring:message code="employeelist.password"/></b></td>
                            <td><b><spring:message code="employeelist.spolocnost"/></b></td>
                            <td><b><spring:message code="employeelist.enabled"/></b></td>
                            <td><b><spring:message code="employeelist.authority"/></b></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <c:forEach items="${employees}" var="employee">
                            <tr>
                                <td><c:out value="${employee.name}" /></td>
                                <td><c:out value="${employee.surname}" /></td>
                                <td><c:out value="${employee.birthDate}" /></td>
                                <td><c:out value="${employee.username}" /></td>
                                <td><c:out value="${employee.password}" /></td>
                                <td><c:out value="${employee.company.name} " /></td>
                                <td><c:out value="${employee.enabled} " /></td>
                                <td><c:out value="${employee.authority} " /></td>
                                <td><a href="./employeeEditJSP/${employee.id}"><spring:message code="employeelist.upravit"/></a></td>
                                <td><a href="./employeeDelete?id=${employee.id}"><spring:message code="employeelist.zmazat"/></a></td>
                            </tr>
                        </c:forEach>   
                    </table>
                </div>
            </div>
            <div class="footer">
                Team: Andrej Hraško, Ondřej Myška, Lukáš Slovák, Michal Polkoráb
            </div>
        </div>
    </body>
</html>
